package ar.edu.itba.it.cg.grupo01.game.terrain.proctextures;

import java.awt.Color;

import com.jmex.terrain.util.AbstractHeightMap;

public class OrganicProceduralTexture extends CustomProceduralTextureGenerator {

   public OrganicProceduralTexture(AbstractHeightMap heightMap) {
		super(heightMap);
	}

private final Color noNoiseColor = new Color(0.4196f,0.5568f,0.1372f);
   private final Color fullNoiseColor = new Color(0.0f, 0.3921f, 0.0f);
   
	@Override
	protected int getTextureColor(int x, int y) {

		float scaleFactor = 0.1f;
		
        float noise = PerlinNoiseGenerator.noise2(x * scaleFactor, y * scaleFactor);
        noise =  (float) (noise - Math.floor(noise));
        
        Color resultColor = PerlinNoiseGenerator.getPerlinColor(noise, noNoiseColor, fullNoiseColor);
        
        return resultColor.getRGB();
	}

}
